home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / ohlcpio.zip / GLOBAL.C < prev    next >
C/C++ Source or Header  |  1990-07-07  |  3KB  |  99 lines

  1. /* global.c - global variables and initial values for cpio.
  2.    Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  3.  
  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 1, or (at your option)
  7.    any later version.
  8.  
  9.    This program is distributed in the hope that it will be useful,
  10.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.    GNU General Public License for more details.
  13.  
  14.    You should have received a copy of the GNU General Public License
  15.    along with this program; if not, write to the Free Software
  16.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. #include "cpio.h"
  19. #include "dstring.h"
  20.  
  21. /* If TRUE, reset access times after reading files (-a). */
  22. int reset_time_flag = FALSE;
  23.  
  24. /* Block size value, initially 512.  -B sets to 5120. */
  25. int io_block_size = 512;
  26.  
  27. /* If TRUE, recognize binary header format for copy in (-b). */
  28. int binary_flag = FALSE;
  29.  
  30. /* If TRUE, use ASCII header format for copy out
  31.    and recognize ASCII header format for copy in (-c).  */
  32. int portability_flag = FALSE;
  33.  
  34. /* If TRUE, create directories as needed. (-d with -i or -p) */
  35. int create_dir_flag = FALSE;
  36.  
  37. /* If TRUE, interactively rename files. (-r) */
  38. int rename_flag = FALSE;
  39.  
  40. /* If TRUE, print a table of contents of input. (-t) */
  41. int table_flag = FALSE;
  42.  
  43. /* If TRUE, copy unconditionally (older replaces newer). (-u) */
  44. int unconditional_flag = FALSE;
  45.  
  46. /* If TRUE, list the files processed, or ls -l style output with -t. (-v) */
  47. int verbose_flag = FALSE;
  48.  
  49. /* If TRUE, link files whenever possible.  Used with -p option. (-l) */
  50. int link_flag = FALSE;
  51.  
  52. /* If TRUE, retain previous file modification time. (-m) */
  53. int retain_time_flag = FALSE;
  54.  
  55. /* With -i; if TRUE, copy only files that match any of the given patterns;
  56.    if FALSE, copy only files that do not match any of the patterns. (-f) */
  57. int copy_matching_files = TRUE;
  58.  
  59. /* With -itv; if TRUE, list numeric uid and gid instead of translating them
  60.    into names. */
  61. int numeric_uid = FALSE;
  62.  
  63. /* Input and output buffers. */
  64. char *input_buffer, *output_buffer;
  65.  
  66. /* Current locations in `input_buffer' and `output_buffer'. */
  67. char *in_buff, *out_buff;
  68.  
  69. /* Current number of bytes stored at `input_buff' and `output_buff'. */
  70. int input_size, output_size;
  71.  
  72. /* Total number of bytes read and written for all files. */
  73. int input_bytes, output_bytes;
  74.  
  75. /* Saving of argument values for later reference. */
  76. char *directory_name;
  77. char **save_patterns;
  78. int num_patterns;
  79.  
  80. /* TRUE if input (cpio -i) or output (cpio -o) is a device node. */
  81. char input_is_special = FALSE;
  82. char output_is_special = FALSE;
  83.  
  84. /* TRUE if lseek works on the input. */
  85. char input_is_seekable = FALSE;
  86.  
  87. /* TRUE if lseek works on the output. */
  88. char output_is_seekable = FALSE;
  89.  
  90. /* The name this program was run with. */
  91. char *program_name;
  92.  
  93. /* A pointer to either lstat or stat, depending on whether
  94.    dereferencing of symlinks is done for input files.  */
  95. int (*xstat) ();
  96.  
  97. /* Which copy operation to perform. (-i, -o, -p) */
  98. void (*copy_function) () = 0;
  99.